// src/api/modules/order.js
import request from '@/utils/request'

export const orderAPI = {
  // 获取订单列表
  getList: (params) => request.get('/orders', { params }),
  
  // 获取订单详情
  getDetail: (id) => request.get(`/orders/${id}`),
  
  // 更新订单状态
  updateStatus: (id, status) => request.patch(`/orders/${id}/status`, { status }),
  
  // 取消订单
  cancel: (id, reason) => request.post(`/orders/${id}/cancel`, { reason }),
  
  // 发货
  ship: (id, data) => request.post(`/orders/${id}/ship`, data),
  
  // 获取订单统计
  getStats: (params) => request.get('/orders/stats', { params })
}